package cn.com.infohold.smartcity.data;

import android.text.TextUtils;

import library.utils.XmlEditor;

/**
 * Created by apple on 2017/4/19.
 */

public class XmlConfig extends XmlEditor {
    private static final String KEY_AUTO_LOGIN = "sp.data.key.auto_login";
    private static final String KEY_VERSION_CODE = "sp.data.key.version.code";


    private static final XmlConfig INSTANCE = new XmlConfig();

    public static XmlConfig getInstance() {
        return INSTANCE;
    }

    public void setAutoLogin(boolean autoLogin) {
        putBoolean(KEY_AUTO_LOGIN, autoLogin);
        commit();
    }

    public boolean isAutoLogin() {
        return getBoolean(KEY_AUTO_LOGIN, true);
    }

    public void setVersionCode(int vCode) {
        putInt(KEY_VERSION_CODE, vCode);
        commit();
    }

    public int getVersionCode() {
        return getInt(KEY_VERSION_CODE, 0);
    }

}
